<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2008 XBRL International. All Rights Reserved. -->
<?xml-stylesheet type="text/xsl" href="../stylesheets/functionDefinition.xsl"?>
<function
  xmlns="http://xbrl.org/2008/function" 
  xmlns:reg="http://xbrl.org/2008/registry" 
  xmlns:xhtml="http://www.w3.org/1999/xhtml" 
  xmlns:xfi="http://www.xbrl.org/2008/function/instance"
  xmlns:xfie="http://www.xbrl.org/2008/function/instance/error"
  xmlns:xbrli="http://www.xbrl.org/2003/instance" 
  xmlns:xlink="http://www.w3.org/1999/xlink" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="
  http://xbrl.org/2008/registry ../schemas/registry.xsd
  http://xbrl.org/2008/function ../schemas/function.xsd
  ">

  <lastUpdated moment="2010-09-09T00:00:00" />

  <owners>
    <reg:owner id="herm">
       <reg:name>Herm Fischer</reg:name>
      <reg:affiliation>UBMatrix / Mark V Systems</reg:affiliation>
       <reg:email>fischer@markv.com</reg:email>
       <reg:assumedOwnership moment="2008-09-01T00:00:00" />
    </reg:owner>
  </owners>

  <summary>
    Returns a string containing the definition of the arcrole, or an empty sequence if none.
  </summary>

  <documentation>
    To provide a human-readable definition for an arcrole which may or may not have a definition, for the arcroleURI $arcrole, use this XPath2 construct: "(xfi:arcrole-definition($arcrole),$arcrole)[1]".  It will select the arcrole definition if there is one, and otherwise show the arcrole's URI.
  </documentation>

  <signature name="xfi:arcrole-definition">

    <input name="arcrole" type="xs:string">
      <xhtml:p>
        The subject arcrole.
      </xhtml:p>
    </input>

    <input name="xbrlinstance" type="element(xbrli:xbrl)">
      <xhtml:p>
        This parameter is optional.  If absent the target XBRL instance provides the DTS for arcrole definitions.
        If provided then the specified XBRL instance provides the DTS of the arcrole definition.
      </xhtml:p>
    </input>

    <output type="xs:string?">
      <xhtml:p>
        Returns the definition (if found) or an empty sequence (if not found, or if no definition specified).  If multiple arcroleTypes for this arcrole are present in the DTS any one is returned at the discretion of the implementation.
      </xhtml:p>
    </output>
  </signature>

  <conformanceTest xlink:type="simple" xlink:href="90504 xfi.arcrole-definition testcase.xml"/>

  <revisions>
    <reg:revision on="2008-12-12T00:00:00" by="herm">
      <xhtml:p>
        Created the function definition.
      </xhtml:p>
    </reg:revision>

    <reg:revision on="2009-12-12T00:00:00" by="herm">
      <xhtml:p>
        Removed reference to dynamically loaded instances from the xbrlinstance input and clarified attribute definition.
      </xhtml:p>
    </reg:revision>

    <reg:revision on="2010-09-07T00:00:00" by="herm">
      <xhtml:p>
        Incorporated feedback from Hitoshi Okumura.
        Changed output type from xs:string to xs:string? to allow empty sequence result when no definition.
      </xhtml:p>
    </reg:revision>

    <reg:revision on="2010-09-09T00:00:00" by="herm">
      <xhtml:p>
        Changed arcrole URIs to strings for cast-less coding and to be similar to fn:QName's $paramURI, an xs:string.
      </xhtml:p>
    </reg:revision>
  </revisions>

</function>
